// *************************************************************************************************
//
// MK3D Engine
// --------------------------------------
// Copyright (C) 2007-2011 Zeb (mailto: zebbey@gmail.com)
//
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
//
// *************************************************************************************************

#ifndef __H_MK_REPR_SKY_BOX__
#define __H_MK_REPR_SKY_BOX__

#include "mk_entity.h"

namespace MK3DE
{
	enum SKY_BOX_PLANE
	{
		SBP_LEFT = 0,
		SBP_RIGHT = 1,
		SBP_TOP = 2,
		SBP_BOTTOM = 3,
		SBP_FRONT = 4,
		SBP_BACK = 5,
		SBP_MAX = 6,
	};

	class CScene;
	class CRenderInput;
	class CTexture2D;
	class CHardwareBuffer;
	class CShader;

	class MK3DE_API CEntitySkyBox : public CEntity
	{
	public:
		CEntitySkyBox(CScene* pScene);
		~CEntitySkyBox();

		//! Get entity render type and entity type.
		ENTITY_RENDER_TYPE GetRenderType() { return ERT_SOLID; }
		ENTITY_TYPE GetType() { return ET_SKY_BOX; }

		//! Create the sky box entity.
		/**
		\param shaderFile : the name of the shader file which is used to render this sky box.
		\param size : the size of the sky box.
		\return : If the method suceeds, return TRUE or return FALSE.
		*/
		BOOL Create(const char* shaderFile, float size);

		//! Set texture for a sky box plane.
		/**
		\param plane : which plane.
		\param fileName : the texture file name.
		\return : If the method suceeds, return TRUE or return FALSE.
		*/
		BOOL SetTexture(SKY_BOX_PLANE plane, const char* fileName);

		//! Render the sky box entity.
		void Render();

	private:
		CRenderInput* _renderInput;
		CHardwareBuffer* _vertexBuffer;
		CTexture2D* _texture[SBP_MAX];
		CShader* _shader;
	};
};

#endif // __H_MK_REPR_SKY_BOX__